// export function timestampToTime(timestamp) {
//   const date = new Date(timestamp * 1000) // 将秒转换为毫秒
//   const year = date.getFullYear()
//   const month = ('0' + (date.getMonth() + 1)).slice(-2) // 月份是从0开始的
//   const day = ('0' + date.getDate()).slice(-2)
//   const hours = ('0' + date.getHours()).slice(-2)
//   const minutes = ('0' + date.getMinutes()).slice(-2)
//   const seconds = ('0' + date.getSeconds()).slice(-2)
//   return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
// }

// export function getQueryParams() {
//   const params = new URLSearchParams(window.location.search)
//   const queryParams = {}

//   for (const [key, value] of params.entries()) {
//     queryParams[key] = value
//   }

//   return queryParams
// }

import { useUrlSearchParams } from '@vueuse/core'

export function timestampToTime(timestamp) {
  const date = new Date(timestamp * 1000) // 将秒转换为毫秒
  const year = date.getFullYear()
  const month = ('0' + (date.getMonth() + 1)).slice(-2) // 月份是从0开始的
  const day = ('0' + date.getDate()).slice(-2)
  const hours = ('0' + date.getHours()).slice(-2)
  const minutes = ('0' + date.getMinutes()).slice(-2)
  const seconds = ('0' + date.getSeconds()).slice(-2)
  return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds
}

export function getQueryParams() {
  return useUrlSearchParams('history')
}
